package com.hugo.maomi_first.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;

/**
 *  scrollview 中内嵌 listview 的简单实现
	解决滚动冲突
 * Created by yi on 2016/7/1.
 */
public class ScrollViewWithListView extends ListView{
    public ScrollViewWithListView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    /**
     * Integer.MAX_VALUE  >>  2,如果不设置,系统默认设置是显示两条
     * @param widthMeasureSpec
     * @param heightMeasureSpec
     */
    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec){
        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);
    }
}
